import {
  createRouter,
  createWebHashHistory,
  createWebHistory,
} from "vue-router";

import Layout from "@/layout/layout.vue";
import H5Layout from "../bridge-h5/views/layout/layout.vue";
// import webPage from '../bridge-web/index.vue'
const briHome = (resolve) =>
  require.ensure([], () =>
    resolve(require("../bridge-h5/views/brihome/index.vue"))
  ); //首页

const routes = [
  // {
  //   path: '/redirect',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/redirect/:path(.*)',
  //       component: () => import('@/views/redirect/index')
  //     }
  //   ]
  // },

  //#region
  // {
  //   path: '/',
  //   component: Layout,
  //   redirect: '/home',
  //   children: [
  //     {
  //       path: '/home',
  //       component: () => import('@/views/home.vue'),
  //       meta: { title: '首页' }
  //     }
  //   ]
  // },

  // {
  //   path: '/user-center',
  //   redirect: '/system/user/user-center',
  //   component: Layout,
  //   hidden: true,
  //   children: [{
  //     path: '/system/user/user-center',
  //     component: () => import('@/views/system/user/user-center'),
  //     meta: { title: '个人中心' }
  //   }]
  // },
  //#endregion

  {
    path: "/home",
    component: Layout,
    children: [
      {
        path: "/home",
        component: () => import("@/views/home.vue"),
        meta: { title: "首页" },
      },
    ],
  },

  //航道专题
  {
    path: "/",
    redirect: "/channel",
    hidden: true,
    component: () => import("../bridge-h5/views/channel/index.vue"),
  },
  {
    path: "/channel",
    component: () => import("../bridge-h5/views/channel/index.vue"),
    name: "channel",
  },
  {
    path: "/wisdomChannel",
    component: () => import("../bridge-h5/views/channel/wisdomChannel.vue"),
    name: "wisdomChannel",
  },
  // {
  //   path: "/wisdom",
  //   component: () => import("../bridge-h5/views/channel/wisdom.vue"),
  //   name: "wisdom",
  //   redirect: "/waterwayGeneralization",
  //   children: [
  //     {
  //       path: "/shipSurvey",
  //       component: () => import("../bridge-h5/views/channel/shipSurvey.vue"),
  //       name: "shipSurvey",
  //     },
  //     {
  //       path: "/bridgeHeight",
  //       component: () => import("../bridge-h5/views/channel/bridgeHeight.vue"),
  //       name: "bridgeHeight",
  //     },
  //     {
  //       path: "/waterLevel",
  //       component: () => import("../bridge-h5/views/channel/waterLevel.vue"),
  //       name: "waterLevel",
  //     },
  //     {
  //       path: "/waterwayGeneralization",
  //       component: () =>
  //         import("../bridge-h5/views/channel/waterwayGeneralization.vue"),
  //       name: "waterwayGeneralization",
  //     },
  //     {
  //       path: "/navigationMark",
  //       component: () => import("../bridge-h5/views/channel/navigationMark.vue"),
  //       name: "navigationMark",
  //     },
  //     {
  //       path: "/wisdomShiplock",
  //       component: () => import("../bridge-h5/views/channel/wisdomShiplock.vue"),
  //       name: "wisdomShiplock",
  //     },
  //     {
  //       path: "/videoSurveillance",
  //       component: () => import("../bridge-h5/views/channel/videoSurveillance.vue"),
  //       name: "videoSurveillance",
  //     },
  //   ]
  // },
  {
    path: "/shipSurvey",
    component: () => import("../bridge-h5/views/channel/shipSurvey.vue"),
    name: "shipSurvey",
  },
  {
    path: "/bridgeHeight",
    component: () => import("../bridge-h5/views/channel/bridgeHeight.vue"),
    name: "bridgeHeight",
  },
  {
    path: "/waterLevel",
    component: () => import("../bridge-h5/views/channel/waterLevel.vue"),
    name: "waterLevel",
  },
  {
    path: "/waterwayGeneralization",
    component: () =>
      import("../bridge-h5/views/channel/waterwayGeneralization.vue"),
    name: "waterwayGeneralization",
  },
  {
    path: "/navigationMark",
    component: () => import("../bridge-h5/views/channel/navigationMark.vue"),
    name: "navigationMark",
  },
  {
    path: "/wisdomShiplock",
    component: () => import("../bridge-h5/views/channel/wisdomShiplock.vue"),
    name: "wisdomShiplock",
  },
  {
    path: "/videoSurveillance",
    component: () => import("../bridge-h5/views/channel/videoSurveillance.vue"),
    name: "videoSurveillance",
  },
  {
    path: "/videoList",
    component: () => import("../bridge-h5/views/channel/videoList.vue"),
    name: "videoList",
  },
  {
    path: "/videoDetails",
    component: () => import("../bridge-h5/views/channel/videoDetails.vue"),
    name: "videoDetails",
  },
  {
    path: "/notice",
    component: () => import("../bridge-h5/views/channel/notice.vue"),
    name: "notice",
  },
  {
    path: "/pdf",
    component: () => import("../bridge-h5/views/channel/pdf.vue"),
    name: "pdf",
  },
  {
    path: "/administrative",
    component: () => import("../bridge-h5/views/channel/administrative.vue"),
    name: "administrative",
  },

  //闸坝专题
  {
    path: "/myLayout",
    component: () => import("../bridge-h5/views/gateDam/myLayout.vue"),
    redirect: "/gateDam",
    children: [
      {
        path: "/gateDam",
        component: () => import("../bridge-h5/views/gateDam/index.vue"),
        name: "gateDam",
      },
      {
        path: "/lianjiangDetails",
        component: () => import("../bridge-h5/views/gateDam/details.vue"),
        name: "lianjiangDetails",
      },
      {
        path: "/beijiangDetails",
        component: () =>
          import("../bridge-h5/views/gateDam/beijiangDetails.vue"),
        name: "beijiangDetails",
      },
      {
        path: "/channelNotice",
        component: () => import("../bridge-h5/views/gateDam/channelNotice.vue"),
        name: "channelNotice",
      },
    ],
  },
  {
    path: "/statisticalAnalysis",
    component: () =>
      import("../bridge-h5/views/gateDam/statisticalAnalysis.vue"),
    name: "statisticalAnalysis",
  },
  {
    path: "/weather",
    component: () => import("../bridge-h5/views/gateDam/weather.vue"),
    name: "weather",
  },
  {
    path: "/lockRecord",
    component: () => import("../bridge-h5/views/gateDam/lockRecord.vue"),
    name: "lockRecord",
  },
  {
    path: "/records",
    component: () => import("../bridge-h5/views/gateDam/records.vue"),
    name: "records",
  },

  {
    path: "/login",
    component: () => import("@/views/login.vue"),
    hidden: true,
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404.vue"),
    hidden: true,
  },
  {
    path: "/error",
    name: "error",
    component: () => import("../bridge-h5/views/channel/error.vue"),
  },

  // {
  //   path: '/:pathMatch(.*)*',
  //   redirect: '/404',
  //   hidden: true
  // }
  // h5页面的
  // {
  //   path: '/',
  //   redirect: '/brihome',
  //   component: briHome,
  // },

  // {
  //   path: '/',
  //   component: H5Layout,
  //   redirect: '/brihome',
  //   name:'brihome',
  //   children: [
  //     {
  //       path: '/brihome',
  //       component: () => import('../bridge-h5/views/brihome/index.vue'),
  //       meta: { title: '首页' }
  //     }
  //   ]
  // },

  {
    path: "/bridgeSituation",
    component: H5Layout,
    name: "bridgeSituation",
    // meta:{keepAlive:false},
    children: [
      {
        path: "/bridgeSituation",
        component: () => import("../bridge-h5/views/bridgeSituation/index.vue"),
        // meta: { title: '桥梁情况',	keepAlive: true }
      },
    ],
  },
  {
    path: "/channelSituation",
    component: H5Layout,
    name: "channelSituation",
    meta: { keepAlive: false },
    children: [
      {
        path: "/channelSituation",
        component: () =>
          import("../bridge-h5/views/channelSituation/index.vue"),
        meta: { title: "航道情况", keepAlive: false },
      },
    ],
  },
  {
    path: "/shipSituation",
    component: H5Layout,
    name: "shipSituation",
    children: [
      {
        path: "/shipSituation",
        component: () => import("../bridge-h5/views/shipSituation/index.vue"),
        meta: { title: "船舶情况" },
      },
    ],
  },
  {
    path: "/viewContent",
    component: () => import("../bridge-h5/components/viewContent.vue"),
    name: "viewContent",
    meta: { keepAlive: true },
  },
  {
    path: "/accidentInformation",
    component: () => import("../bridge-h5/components/accidentInformation.vue"),
    name: "accidentInformation",
  },
  //大屏
  {
    path: "/traffic-channel/szsy/big-screen/bigScreen",
    component: () => import("@/views/largeSizeScreen.vue"),
    name: "largeSizeScreen",
  },
  {
    path: "/traffic-channel/szsy/big-screen/bigScreenZhaba",
    component: () => import("@/views/bigScreen.vue"),
    name: "bigScreen",
  },
  {
    path: "/traffic-channel/szsy/big-screen/bigScreenQiaoqu",
    component: () => import("@/views/bigSizeScreen.vue"),
    name: "bigSizeScreen",
  },
  {
    path: "/largeScreen",
    component: () => import("@/views/largeScreen.vue"),
    name: "largeScreen",
  },
  //大屏预发布
  {
    path: "/traffic-channel/pre-yth/szsy/big-screen/bigScreen",
    component: () => import("@/views/largeSizeScreenPreYth.vue"),
    name: "largeSizeScreenPreYth",
  },
  {
    path: "/traffic-channel/pre-yth/szsy/big-screen/bigScreenZhaba",
    component: () => import("@/views/bigScreenPreYth.vue"),
    name: "bigScreenPreYth",
  },
  {
    path: "/traffic-channel/pre-yth/szsy/big-screen/bigScreenQiaoqu",
    component: () => import("@/views/bigSizeScreenPreYth.vue"),
    name: "bigSizeScreenPreYth",
  },
  //1920 x 1080
  {
    path: "/bigScreenNew",
    component: () => import("@/views/largeSizeScreenNew.vue"),
    name: "largeSizeScreenNew",
  },
  {
    path: "/bigScreenZhabaNew",
    component: () => import("@/views/bigScreenNew.vue"),
    name: "bigScreenNew",
  },
  {
    path: "/bigScreenQiaoquNew",
    component: () => import("@/views/bigSizeScreenNew.vue"),
    name: "bigSizeScreenNew",
  },
  // 水上桥区管控-主页
  {
    path: "/bridgeAreaControl",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/bridgeAreaControl.vue"),
    // redirect: "/bridgeAreaControl-overall",
    // children: [
    //   {
    //     path: "/bridgeAreaControl-overall",
    //     component: () => import("../bridge-h5/views/bridgeAreaControl/overall/index.vue"),
    //     name: "bridgeAreaControl-overall",
    //   },
    //   {
    //     path: "/bridgeAreaControl-bridge",
    //     component: () => import("../bridge-h5/views/bridgeAreaControl/bridge/index.vue"),
    //     name: "bridgeAreaControl-bridge",
    //   },
    //   {
    //     path: "/bridgeAreaControl-channel",
    //     component: () => import("../bridge-h5/views/bridgeAreaControl/channel/index.vue"),
    //     name: "bridgeAreaControl-channel",
    //   },
    //   {
    //     path: "/bridgeAreaControl-ship",
    //     component: () => import("../bridge-h5/views/bridgeAreaControl/ship/shipIndex.vue"),
    //     name: "bridgeAreaControl-ship",
    //   },
    // ],
  },
  // 一览页
  {
    path: "/bridgeAreaControl-overall",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/overall/index.vue"),
    name: "bridgeAreaControl-overall",
  },
  // 桥区日常管理
  {
    path: "/dailyManagement",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/dailyManagement.vue"),
    redirect: "/bridgeAreaControl-bridge",
    children: [
      {
        path: "/bridgeAreaControl-bridge",
        component: () =>
          import("../bridge-h5/views/bridgeAreaControl/bridge/index.vue"),
        name: "bridgeAreaControl-bridge",
      },
      {
        path: "/bridgeAreaControl-channel",
        component: () =>
          import("../bridge-h5/views/bridgeAreaControl/channel/index.vue"),
        name: "bridgeAreaControl-channel",
      },
      {
        path: "/bridgeAreaControl-ship",
        component: () =>
          import("../bridge-h5/views/bridgeAreaControl/ship/shipIndex.vue"),
        name: "bridgeAreaControl-ship",
      },
    ],
  },
  // 事故案例剖析
  {
    path: "/caseAnalysis",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/caseAnalysis.vue"),
    name: "caseAnalysis",
  },
  {
    path: "/caseAnalysisDetails",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/caseAnalysisDetails.vue"),
    name: "caseAnalysisDetails",
  },
  // 水上桥区管控-天气
  {
    path: "/bridgeAreaControl-weather",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/weather.vue"),
    name: "bridgeAreaControl-weather",
  },
  // 水上桥区管控-桥梁-一桥一方案图
  {
    path: "/bridge_scheme",
    component: () =>
      import(
        "../bridge-h5/views/bridgeAreaControl/component/bridge_scheme.vue"
      ),
    name: "bridgeAreaControl-bridge-scheme",
  },
  // 水上桥区管控-桥梁-设计图纸
  {
    path: "/bridge_sjtz",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/bridge_sjtz.vue"),
    name: "bridgeAreaControl-bridge-sjtz",
  },
  // 水上桥区管控-桥梁-预警情况
  {
    path: "/bridge_yjqk",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/bridge_yjqk.vue"),
    name: "bridgeAreaControl-bridge-yjqk",
  },
  // 水上桥区管控-桥梁-水位情况
  {
    path: "/bridge_swqk",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/bridge_swqk.vue"),
    name: "bridgeAreaControl-bridge-swqk",
  },
  // 水上桥区管控-航道-关联桥梁
  {
    path: "/channel_glql",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/channel_glql.vue"),
    name: "bridgeAreaControl-channel-glql",
  },
  // 水上桥区管控-航道-船舶流量详情
  {
    path: "/channel_cbll",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/channel_cbll.vue"),
    name: "bridgeAreaControl-channel-cbll",
  },
  // 水上桥区管控-航道-巡检情况
  {
    path: "/channel_xjqk",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/component/channel_xjqk.vue"),
    name: "bridgeAreaControl-channel-xjqk",
  },
  // 中山先行示范区
  {
    path: "/demonstrationPlot",
    component: () =>
      import("../bridge-h5/views/bridgeAreaControl/demonstrationPlot.vue"),
    name: "demonstrationPlot",
  },
  // 中山先行示范区-水位情况
  {
    path: "/bridgeSwqkZhongshan",
    component: () =>
      import(
        "../bridge-h5/views/bridgeAreaControl/component/bridge_swqk_zhongshan.vue"
      ),
    name: "bridgeSwqkZhongshan",
  },
  // PC
  {
    path: "/gateDamIndex",
    component: () => import("@/views/pc/gateDamIndex"),
    name: "gateDamIndex",
  },
  {
    path: "/beijiangIndex",
    component: () => import("@/views/pc/beijiangIndex"),
    name: "beijiangIndex",
  },
  {
    path: "/lianjiangIndex",
    component: () => import("@/views/pc/lianjiangIndex"),
    name: "lianjiangIndex",
  },
  {
    path: "/bridgeIndex",
    component: () => import("@/views/pc/bridgeIndex"),
    name: "bridgeIndex",
  },
  {
    path: "/zhongshanIndex",
    component: () => import("@/views/pc/zhongshanIndex"),
    name: "zhongshanIndex",
  },
  {
    path: "/bridgeManage",
    component: () => import("@/views/pc/bridgeManage"),
    name: "bridgeManage",
  },
  {
    path: "/channelIndex",
    component: () => import("@/views/pc/channelIndex"),
    name: "channelIndex",
  },
  {
    path: "/moreIndex",
    component: () => import("@/views/pc/moreIndex"),
    name: "moreIndex",
  },
  //数字水运PC端
  {
    path: "/szsyBridgeIndex",
    component: () => import("@/views/pc/szsyBridgeIndex"),
    name: "szsyBridgeIndex",
  },
  {
    path: "/szsyBridgeManage",
    component: () => import("@/views/pc/szsyBridgeManage"),
    name: "szsyBridgeManage",
  },
  {
    path: "/szsyZhongshanIndex",
    component: () => import("@/views/pc/szsyZhongshanIndex"),
    name: "szsyZhongshanIndex",
  },
  {
    path: "/szsyGateDamIndex",
    component: () => import("@/views/pc/szsyGateDamIndex"),
    name: "szsyGateDamIndex",
  },
  {
    path: "/szsyBeijiangIndex",
    component: () => import("@/views/pc/szsyBeijiangIndex"),
    name: "szsyBeijiangIndex",
  },
  {
    path: "/szsyLianjiangIndex",
    component: () => import("@/views/pc/szsyLianjiangIndex"),
    name: "szsyLianjiangIndex",
  },
];

const router = createRouter({
//history: createWebHashHistory(),
history: createWebHistory(),
  routes,
});

export default router;
